import React, { useState } from 'react';
import TodoHeader from "./components/TodoHeader";
import TodoMain from "./components/TodoMain";
import TodoFooter from "./components/TodoFooter";
import "./App.css";

function App(props) {
    // 定义用于保存任务列表数据
    const [taskList, setTaskList] = useState([])

    function addTask(e) {
        // 判断是否按下回车
        if (e.keyCode === 13) {
            const title = e.target.value.trim()
            if(title.length === 0) {
                alert('请输入任务标题')
                return
            }
            // 判断是否重复
        }
    }

    return (
        <div className="todo-container">
            <div className="todo-wrap">
                <TodoHeader />
                <TodoMain  />
                <TodoFooter />
            </div>
        </div>
    );
}

export default App;